package com.woniu.learnredirect.controller;

import com.woniu.learnredirect.entity.User;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


/**
 * created by woniu201
 * created in 2018/4/12
 */
@RestController
public class Test2Controller {

    @RequestMapping(value = "/test2", method = RequestMethod.POST)
    public User test1(@RequestBody User user){
        System.out.println(user.getName());
        System.out.println(user.getAge());
        System.out.println("test2 ---- 1");
        return user;
    }

    @RequestMapping(value = "/test2/a", method = RequestMethod.POST)
    public User test2(@RequestBody User user){
        System.out.println(user.getName());
        System.out.println(user.getAge());
        System.out.println("test2 ---- 2");
        return user;
    }

    @RequestMapping(value = "/test2/a/b", method = RequestMethod.POST)
    public User test3(@RequestBody User user){
        System.out.println(user.getName());
        System.out.println(user.getAge());
        System.out.println("test2 ---- 3");
        return user;
    }
}
